<template>
	<el-button :class="customClass" @click="handleClick">
		{{ text }}
	</el-button>
</template>

<script lang="ts" setup>
import { computed } from 'vue';

// 定义组件的属性
const props = defineProps({
	// 按钮文字
	text: {
		type: String,
		required: true
	},
	// 自定义类名
	customClass: {
		type: String,
		default: ''
	},
	type: {
		type: String,
		default: 'primary'
	}
});

// 定义事件
const emit = defineEmits(['showTimeSelect']);

// 点击事件处理
const handleClick = (event: MouseEvent) => {
	if (props.type === 'showTimeSelect') {
		console.log('showTimeSelect button click');
		emit('showTimeSelect'); // 移除 event 参数，简化事件发射
	}
};
</script>

<style lang="scss" scoped>
.el-button {
	&:focus {
		outline: none;
	}
}
</style>
